package com.fuyd.pms.entity;

import com.fuyd.pms.entity.base.BaseEntityCode;
import org.hibernate.annotations.Type;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 国家地区表，存储省市区等地区结构
 * Created by fuyongde on 2016/1/13.
 */
@Entity
@Table(name = "region")
public class Region extends BaseEntityCode {
    /**地区的父级id**/
    private String parentId;
    /**地区的名称**/
    private String name;
    /**地区的级别**/
    private int level;

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    @Type(type = "string")
    @Length(max = 128)
    @Column(nullable = false)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
